<?php
namespace app\api\model;
use think\Db;
use think\Model;

class Test extends Model
{
	// public $user = new Test;
	public  static function updateTest(){
		$user = new Test;
		// save方法第二个参数为更新条件
		$user->save([
		    'name'  => 'thinkphpTEst',
		    'phone' => 13211111111
		],['id' => 1]);
	}

	public  static function saveTest(){
		$user = new Test;
		$user->data([
			'id'=>null,
		    'name'  =>  'thinkphp',
		    'password' =>  'thinkphp@qq',
		    'phone' => 13211111111
		]);
		$user->save();
	}
}